﻿using Avalon.Core.Data;
using System;
using System.Collections.Generic;
using System.Linq;

namespace Avalon.Core.MVC.StateBags {
    public class CollectionBag<TModel> : ICollectionBag<TModel> where TModel : class, IEntity, new() {
        public IQueryable<TModel> Models { get; set; }
        public Exception Error { get; set; }
        public Dictionary<string, object> ParameterValues { get; set; }

        public dynamic Result {
            get {
                return Models;
            }
            set {
                Models = value;
            }
        }

        public CollectionBag() {
            ParameterValues = new Dictionary<string, object>();
        }
    }
}
